<?php use_helper('Date') ?>
<?php use_helper('Text') ?>

<?php use_javascript('home_foucs/yu') ?>
<?php use_javascript('home_foucs/tb') ?>

<?php slot('title', "{$area}赛区 - ") ?>
<?php slot('area', "{$area}赛区") ?>
<!--Content 1-->
<div class="home_cont1">
   <div class="home_cont1_left">
      <!--Foucs Start-->
      <div id="focus-image">
      <div id="slide-player">
        <?php if (count($slideShow)): ?>
         <ul class="slides">
            <?php foreach ($slideShow as $image): ?>
            <li><a href="<?php echo $image->getUrl() ?>"><img src="<?php printf(sfConfig::get('app_path_area_image'), $image->getImage()) ?>" width="300" height="400" alt="<?php echo $image->getTitle() ?>" /></a></li>
            <?php endforeach ?>
          </ul>
        <?php endif ?>
      </div>
      </div>
      <!--Foucs Over-->
      <div class="home_cont1_left_div2">
         <span class="ft5"><a href="<?php echo url_for('@article_category?catid=5') ?>" style="color:#e945c0;">更多 >></a></span>
		 <?php if (count($plans)): ?>
         <ul>
		     <?php foreach ($plans as $plan): ?>
            <li><a href="<?php echo url_for('@article_show?id=' . $plan->getId()) ?>"><?php echo truncate_text($plan, 15, '') ?></a></li>
			 <?php endforeach ?>
         </ul>
		 <?php endif ?>
      </div>
   </div>
   
   <!--Headline-->
 <?php if (count($hots)): ?> 
 <div class="home_cont1_center">
            
      <span class="ft6"><a href="<?php echo url_for('@article_category?catid=4') ?>">更多 >></a></span>         
	<?php foreach ($hots as $article): ?>
      <dl>
         <dt><a href="<?php echo $article->getUrl() ?>"><?php echo $article ?></a></dt>
         <?php foreach ($article->getChildren() as $a): ?>
		 <dd><a href="<?php echo $a->getUrl() ?>">[<?php echo $a ?>]</a></dd>
		 <?php endforeach ?>
      </dl>
	<?php endforeach ?>
  </div>
   <?php endif ?>
   <!--Bulletin-->
   <div class="home_cont1_right">
     <div class="home_cont1_right_div1">
         <span class="ft7"><a href="<?php echo url_for('@article_category?catid=6') ?>">更多 >></a></span>
         <ul>
			 <?php foreach ($bulletin as $article): ?>
            <li><a href="<?php echo url_for('@article_show?id=' . $article->getId()) ?>"><?php echo truncate_text($article, 15, '') ?></a></li>
             <?php endforeach ?>
         </ul>
     </div>
     <div class="home_cont1_right_div2"><img src="/images/video.gif" width="270" height="215" alt="视频欣赏" /></div>
   </div>
   <div class="clears"></div>
</div>

<!--Car AD-->
<div class="ad1"><a href="#"><img src="/images/ad-1.jpg" width="950" height="120" alt="" /></a></div>

<!--Content 2-->
<div class="home_cont2">
   <div class="home_cont2_top"><span class="ft8"><span class="ft9">参赛佳丽</span><a href="<?php echo url_for('@contestant') ?>">更多 >></a></span></div>
   <div class="home_cont2_bottom">
   <?php if ($cnt = count($contestants)): ?>
      <ul>
	   <?php for ($i = 0; $i < $cnt && $i < 12; $i++): ?>
         <li><a href="<?php 
                echo url_for('@contestant_show?id=' . $contestants[$i]->getId())
              ?>"><img src="<?php printf(sfConfig::get('app_path_contestant_portrait'), $contestants[$i]->getPortrait()) ?>" width="123" height="182" alt="<?php echo $contestants[$i]->getName() ?>" /></a><span class="ft3"><?php echo $contestants[$i]->getArea() ?> <?php echo $contestants[$i]->getName() ?></span></li>
       <?php endfor ?>
      </ul>
   <?php endif ?>
      <div class="clears"></div>
   </div>
</div>

<!--AD-->
<div class="ad1"><a href="#"><img src="/images/ad-2.jpg" width="950" height="120" alt="" /></a></div>

<!--Content 3-->
<div class="home_cont3">
   <div class="home_cont3_top"><span class="ft8"><span class="ft9">精彩照片</span><a href="<?php echo url_for('@photo') ?>">更多 >></a></span></div>
   <div class="home_cont3_bottom">
   <?php if (count($final)): ?>
      <ul>
         <p><img src="/images/js_btn.jpg" width="202" height="107" alt="总决赛" /></p>
		 <?php foreach ($thefinal as $photo): ?>
			<li><a href="<?php echo url_for('@photo_show?id=' . $photo->getId()) ?>"><img src="<?php printf(sfConfig::get('app_path_photo_thumb'), $photo->getThumb()) ?>" width="160" height="107" alt="<?php echo $photo->getTitle() ?>" title="<?php echo $photo->getTitle() ?>" /></a><span><a href="<?php echo url_for('@photo_show?id=' . $photo->getId()) ?>"><?php echo $photo->getTitle() ?></a></span></li>
         <?php endforeach ?>
      </ul>
      <div class="clears"></div>
	<?php endif ?>
    <?php if (count($semifinal)): ?> 
      <ul>
         <p><img src="/images/bjs_btn.jpg" width="202" height="107" alt="半决赛" /></p>
		 <?php foreach ($semifinal as $photo): ?>
			<li><a href="<?php echo url_for('@photo_show?id=' . $photo->getId()) ?>"><img src="<?php printf(sfConfig::get('app_path_photo_thumb'), $photo->getThumb()) ?>" width="160" height="107" alt="<?php echo $photo->getTitle() ?>" title="<?php echo $photo->getTitle() ?>" /></a><span><a href="<?php echo url_for('@photo_show?id=' . $photo->getId()) ?>"><?php echo $photo->getTitle() ?></a></span></li>
         <?php endforeach ?>
      </ul>
      <div class="clears"></div>
	<?php endif ?>
	<?php if (count($primary)): ?>      
      <ul>
         <p><img src="/images/cs_btn.jpg" width="202" height="107" alt="初赛" /></p>
		 <?php foreach ($primary as $photo): ?>
			<li><a href="<?php echo url_for('@photo_show?id=' . $photo->getId()) ?>"><img src="<?php printf(sfConfig::get('app_path_photo_thumb'), $photo->getThumb()) ?>" width="160" height="107" alt="<?php echo $photo->getTitle() ?>" title="<?php echo $photo->getTitle() ?>" /></a><span><a href="<?php echo url_for('@photo_show?id=' . $photo->getId()) ?>"><?php echo $photo->getTitle() ?></a></span></li>
         <?php endforeach ?>
      </ul>
      <div class="clears"></div>
	<?php endif ?>
   </div>
</div>

<!--Content 4-->
<div class="home_cont4">
   <div class="home_cont4_left">
      <div class="home_cont4_left_top"><span class="ft10"><a href="<?php echo url_for('@article_category?catid=2') ?>">更多 >></a></span></div>
      <div class="home_cont4_left_bottom">
	  <?php if (count($latest)): ?>
         <ul>
		 <?php foreach ($latest as $article): ?>
            <li><span><?php echo format_date($article->getCreatedAt(), 'y/M/d'); ?></span><a href="<?php echo url_for('@article_show?id=' . $article->getId()) ?>"><?php echo truncate_text($article, 15, '') ?></a></li>
		<?php endforeach ?>
         </ul>
		<?php endif ?>
      </div>
  </div>
   
   <div class="home_cont4_center">
      <div class="home_cont4_center_top2"><span class="ft10"><a href="<?php echo url_for('@article_category?catid=1') ?>">更多 >></a></span></div>
      <div class="home_cont4_center_bottom">
	     <?php if (count($activity)): ?>
         <ul>
		 <?php foreach ($activity as $article): ?>
            <li><span><?php echo format_date($article->getCreatedAt(), 'y/M/d'); ?></span><a href="<?php echo url_for('@article_show?id=' . $article->getId()) ?>"><?php echo truncate_text($article, 15, '') ?></a></li>
		 <?php endforeach ?>
         </ul>
          <?php endif ?>
      </div>
   </div>
   
   <div class="home_cont4_right">
      <div class="home_cont4_right_top"><span class="ft10"><a href="<?php echo url_for('@article_category?catid=3') ?>">更多 >></a></span></div>
      <div class="home_cont4_right_bottom">
	  <?php if (count($media)): ?>
         <ul>
		  <?php foreach ($media as $article): ?>
            <li><span><?php echo format_date($article->getCreatedAt(), 'y/M/d'); ?></span><a href="<?php echo url_for('@article_show?id=' . $article->getId()) ?>"><?php echo truncate_text($article, 15, '') ?></a></li>
          <?php endforeach ?>
         </ul>
		 <?php endif ?>
      </div>
   </div>
   
  <div class="clears"></div>
</div>

<!--Partenr-->
<div class="part_main">
   <div class="part_top"></div>
   <div class="part_bottom">
	  <?php if (count($partners)): ?>
      <ul>
	     <?php foreach ($partners as $image): ?>
         <li><a href="<?php echo $image->getUrl() ?>"><img src="<?php printf(sfConfig::get('app_path_area_image'), $image->getImage()) ?>" alt="<?php echo $image->getTitle() ?>" title="<?php echo $image->getTitle() ?>"  /></a></li>
		 <?php endforeach ?>
      </ul>
	  <?php endif ?>
      <div class="clears"></div>
   </div>
</div>

<script type="text/javascript">
  TB.widget.SimpleSlide.decoration('slide-player', {eventType:'mouse', effect:'scroll'});
</script>